#ifndef BDIODeviceLibSupportBase_H
#define BDIODeviceLibSupportBase_H

#include "device/IODeviceEventListener.h"
#include "device/IODeviceManager.h"
#include <bitset>

using namespace std;

class BDIODeviceLibSupportBase : public IODeviceEventListener
{
public:

	BDIODeviceLibSupportBase();
	virtual ~BDIODeviceLibSupportBase();

protected:

	// device

	void RegisterDeviceListener();

	static void InitDevices();

	static void DeInitDevices();

	void SendDeviceOperation(IODeviceType type, IODeviceOperation operation, unsigned int ptr);

	void OnIODeviceEvent(IODeviceType type, IODeviceOperation operation, unsigned int ptr);

	void OnTobiiDeviceEvent(IODeviceOperation operation, unsigned int ptr);

	void OnThinkGearDeviceEvent(IODeviceOperation operation, unsigned int ptr);

	void OnArduinoControllerEvent(IODeviceOperation operation, unsigned int ptr);

	// data
	
	bool GetButtonIsDown(int index);

	bool GetButtonIsDown();

	void ClearButton();

	void GetAttentionValue(int& attention);

	void GetRockerValue(int& rockerX1, int& rockerY1, int& rockerX2, int& rockerY2);

	void GetGazePoint(int& x, int& y);

	int m_iAttention;
	bitset<3> m_bButton;
	int m_iRockerX1;
	int m_iRockerY1;
	int m_iRockerX2;
	int m_iRockerY2;
	int m_iGazePointX;
	int m_iGazePointY;


};

#endif